#include<iostream>
#include<algorithm>

using namespace std;
const int N = 1e3 + 10;
int s[N];
int f[N];
int a[N];

int find(int x) {
    return f[x] == x ? x : f[x] = find(f[x]);
}

int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        s[i] = 1;
        f[i] = i;
    }

    for (int i = 1; i <= n; i++) {
        for (int j = i + 1; j <= n; j++) {
            if (a[i] > a[j]) {
                int fi = find(i), fj = find(j);
                if (fi != fj) {
                    // 总是将较小的集合合并到较大的集合
                    if (s[fi] > s[fj]) swap(fi, fj);
                    s[fj] += s[fi];
                    f[fi] = fj;
                }
            }
        }
    }

    int ans = 0;
    for (int i = 1; i <= n; i++) {
        ans = max(ans, s[i]);
    }
    cout << ans << "\n";
    return 0;
}